﻿@{
    Layout = "~/Views/Shared/_Dashboard.cshtml";
}
@UIHelper.ImageTitle(Html.Global("RES_METATAGS"))
@UIHelper.SectionHeader(Html.Global("Metas_SpecifyAdditionalMetas"))
<table>
    <tr>
        <th>
            Name
        </th>
        <th>
            Content
        </th>
        <th>
        </th>
    </tr>
    <tr>
        <td>@Ajax.Dna().TextBox("meta_Name").AutoComplete(new string[] { "application-name", "author", "viewport" }).GetHtml()
        </td>
        <td>@Ajax.Dna().TextBox("meta_Content").GetHtml()
        </td>
        <td>@Ajax.Dna().Button().LocText("RES_ADD").Click("_insertMeta();").GetHtml()
        </td>
    </tr>
</table>
@using (Html.BeginForm())
{
    @Html.AntiForgeryToken()
    @UIHelper.SectionHeader(Html.Global("RES_METATAGS"))
    @Ajax.Dna().TextArea("Metas").Width(590).Height(200).Value(ViewBag.Metas).Resizable().GetHtml()
    <div>
        @Ajax.Dna().Button().LocText("RES_SAVE").ImageIcons(Url.Content("~/content/images/icon_save.gif")).Submit().GetHtml()
    </div>
}
<script type="text/javascript">
    function _insertMeta() {
        var _metaName = $("#meta_Name").val(),
        _metaContent = $("#meta_Content").val();
        if (_metaName && _metaContent) {
            var _val = $("#Metas").val() + "\r" + "<meta name=\"" + _metaName + "\" content=\"" + _metaContent + "\" />";
            $("#Metas").val(_val);
            $("#meta_Content").val("");
            $("#meta_Name").val("").focus();
        }
    }
</script>
